package devbureau.fstore.common;

import java.util.List;

public interface UserRegistry {
    /**
     * @param login
     * @param password
     * @return true or false,if user exists
     * @throws java.lang.Exception if user not exists throws application exception
     */
    public Boolean checkUserPassword(String login,String password) throws Exception;
    /**
     * @param login
     * @return User if user exists, null is user not exists
     * @throws java.lang.Exception
     */
    public User getUser(String login) throws Exception;


    public void registerUser(User user,String password) throws Exception;

    public List<User> getAllUsers();

    /**Update user.
     * @param user is a user with new firstName, LastName
     * @param newPassword is a new password. Set in null or empty if password hasn't been changed
     */
    public void updateUser(User user) throws Exception;


    public void activateUser(String login, boolean state) throws Exception;

    /**
     * Role section
     */

    public List<Role> getAllRoles() throws Exception;
    public Role getRole(Integer id) throws Exception;
}


